#include <iostream>
#include "ShareMemory.hpp"
#include "Fifo.hpp"
#include "Time.hpp"


int main()
{
    cout<<"Time:"<<GetCurTime()<<endl;
    shm.CreateShm();
    shm.AttachShm();

    // shm.ShmMeta();

    gpipe.OpenPipeForRead();

    // 进行IPC
    struct Date *image = (struct Date*)shm.GetAddr();
    while (true)
    {
        gpipe.Wait();    
       
        printf("status: %s\n", image->_status);
        printf("lasttime: %s\n", image->_lasttime);
        printf("image: %s\n", image->_image);
        strcpy(image->_status,"过期");

    }

    shm.DetachShm();
    shm.DeleteShm();
    return 0;
}
